package vm.machine;

public abstract class AbstractInstruction implements Instruction{

    Machine machine;
    AbstractInstruction(Machine machine){
        this.machine = machine;
    }
    @Override
    public void exec() {
        doAction();
        nextPc();
    }
    public abstract  void doAction();
    public  void nextPc(){
        Register pc = machine.getRegister("pc");
        pc.setValue(pc.getValue() + 1);
    };
}
